#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSUInteger,RequestStatus) {
    RequestStatusSuccess = 1,
    RequestStatusCanNotReachable,
    RequestStatusRemoteFaild,
    RequestStatusFormatError,
    RequestStatusLocationError,
};
typedef NS_ENUM(NSUInteger,RequestType) {
    RequestTypePost = 1,
    RequestTypeGet,
    RequestTypePut,
    RequestTypeDelete,
};
@class CTBaseRequest;
typedef void(^RequestResultsBlock)(RequestStatus status,id _Nullable responseObject);
typedef void(^successBlock)(CTBaseRequest *operation,BOOL isSuccess, id responseObject);
typedef void(^failureBlock)(CTBaseRequest *operation, NSError *error);
@interface CTBaseRequest : NSObject
@property(nonatomic, strong) NSString *methodName;
@property(nonatomic, strong) NSMutableDictionary *bodyDic;
@property(nonatomic, strong) NSMutableDictionary *headerDic;
@property (nonatomic ,strong) NSData *data;
@property (nonatomic ,copy) NSArray <NSData *> *imageArray;
@property(nonatomic, strong) NSString *resultMessage;
@property(nonatomic, strong) NSString *code;
@property(nonatomic) BOOL isError;
@property(nonatomic) RequestStatus requestStatus;
@property (nonatomic ,assign) RequestType requestType;
@property (nonatomic ,assign) BOOL showGraphicCode;
 #pragma mark - class fuction
+ (void)postRequestWithMethodName:(NSString *)methodName
parametersDic:(NSDictionary *)parametersDic
success:(successBlock)success;
+(void)getRequestWithMethodName:(NSString *)methodName
parametersDic:(NSDictionary *)parametersDic
success:(successBlock)success;
+(void)putRequestWithMethodName:(NSString *)methodName
parametersDic:(NSDictionary *)parametersDic
success:(successBlock)success;
+(void)deleteRequestWithMethodName:(NSString *)methodName
parametersDic:(NSDictionary *)parametersDic
success:(successBlock)success;
+(void)postImageWithMethodName:(NSString *)methodName
                                 data:(NSData *)data
                              success:(successBlock)success;
+(void)postImagesArrayWithMethodName:(NSString *)methodName
                                      data:(NSArray <NSData *>*)images
                                   success:(successBlock)success;
+(CTBaseRequest*)initRequestWithMethodName:(NSString *)methodName
                             parametersDic:(NSDictionary *)parametersDic;
- (void)postRequestSuccess:(void (^)(CTBaseRequest *operation, id responseObject))success
failure:(void (^)(CTBaseRequest *operation, NSError *error))failure;
- (void)postWithFullUrl:(NSString *)url
success:(void (^)(CTBaseRequest *operation, id responseObject))success
failure:(void (^)(CTBaseRequest *operation, NSError *error))failure;
- (void)getRequestSuccess:(void (^)(CTBaseRequest *operation, id responseObject))success
failure:(void (^)(CTBaseRequest *operation, NSError *error))failure;
- (void)putRequestSuccess:(void (^)(CTBaseRequest *operation, id responseObject))success
failure:(void (^)(CTBaseRequest *operation, NSError *error))failure;
- (void)deleteRequestSuccess:(void (^)(CTBaseRequest *operation, id responseObject))success
failure:(void (^)(CTBaseRequest *operation, NSError *error))failure;
- (void)postImageWithImage:(UIImage *)image
success:(void (^)(CTBaseRequest *operation, id responseObject))success
failure:(void (^)(CTBaseRequest *operation, NSError *error))failure;
- (void)postImageWithImagesData:(NSArray <UIImage *>*)images
success:(void (^)(CTBaseRequest *operation, id responseObject))success
failure:(void (^)(CTBaseRequest *operation, NSError *error))failure;
#pragma mark - BaseNetRequest
#pragma - Dictionary Parameter
- (void)startRequestWithType:(RequestType)type
                     success:(void (^)(CTBaseRequest *operation, id responseObject))success
                     failure:(void (^)(CTBaseRequest *operation, NSError *error))failure;
#pragma - Any Parameter
- (void)startRequestWithType:(RequestType)type
                  parameters:(nullable id)parameters
                     success:(void (^)(CTBaseRequest *operation, id responseObject))success
                     failure:(void (^)(CTBaseRequest *operation, NSError *error))failure;
- (void)setIntegerValue:(NSInteger)value forKey:(NSString *)key;
- (void)setDoubleValue:(double)value forKey:(NSString *)key;
- (void)setLongLongValue:(long long)value forKey:(NSString *)key;
- (void)setBOOLValue:(BOOL)value forKey:(NSString *)key;
- (void)setValue:(id __nullable)value forKey:(NSString *)key;
@end
NS_ASSUME_NONNULL_END
